package com.example.flow.enums;

/**
 * @author tangaq
 * @date 2020/11/25
 */
public enum EnumReply {
    ADOPT("adopt", "同意"),
    REFUSE("refuse", "拒绝"),
    REJECT("reject", "驳回");

    /** 码值 */
    private String code;

    /** 描述 */
    private String desc;

    EnumReply(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnumReply find(String code) {
        if (code == null) {
            return null;
        }
        for (EnumReply e : EnumReply.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
    }
